<template>
    <!-- 组件的结构 -->
     <div>
        <h2>学生姓名: {{ studentName }}</h2>
        <h2>学生年龄: {{ age }}</h2>
        <button @click="showName">点我提示学生名</button>
     </div>
</template>

<script>
    export default {
        name:'StudentVue',
        data () {
            return {
                studentName: 'ZJL',
                age: '24'
            }
        },
        methods: {
            showName(){
                alert(this.studentName)
            }
        }
    }
        
</script>


<style>

</style>